package com.proactive.webapp.util;

public class EncodeHtml {
	public String removeHtmlTag(String input){
		String tagPattern = "<{1}[^>]{1,}>{1}";
		return input.replaceAll(tagPattern, "");
	}
	
	public String getGist(int number, String content){
		String gist = "";
		if(content != null){
			content = removeHtmlTag(content);
			int contentLength = content.toCharArray().length;
			gist = content.substring(0, contentLength > number ? number : contentLength);
			gist += (contentLength > number ? "..." : "");
		}
		return gist;
	}
}
